<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('system_day_statistics', function (Blueprint $table) {
            $table->id();

            $table->char('statistic_name',64)->index()->comment('统计项名称');
            $table->unsignedInteger('date_day')->index()->comment('统计日期');
            $table->unsignedInteger('statistic')->default(0)->comment('统计数值');

            $table->timestamps();
            $table->softDeletes();
        });

        \DB::statement("ALTER TABLE `system_day_statistics` comment '系统日统计表'");
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('system_day_statistics');
    }
};
